
*** Create Figure 4 ***

********************************************************************************
clear 

** read in .dta file **
use "${clean}/who_counts_descriptives.dta", clear

preserve
drop if YOB < 1945
drop if YOB > 1994
keep if MOB==0
myers age, range(0 49)
sum(count)

graph bar, over(age, label(angle(45) labsize(tiny))) title("Age Heaping, 1944-1994, No MOB") note("N=644K, Myers Blended Index: 6.48")
graph save "${output}/graphs/heaping_unreg.gph", replace
graph export "${output}/graphs/heaping_unreg.png", replace

restore

preserve
drop if YOB < 1945
drop if YOB > 1994
keep if MOB==1
myers age, range(0 49)
sum(count)

graph bar, over(age, label(angle(45) labsize(tiny))) title("Age Heaping, 1944-1994, MOB") note("N=485K, Myers Blended Index: .46")
graph save "${output}/graphs/heaping_reg.gph", replace
graph export "${output}/graphs/heaping_reg.png", replace

grc1leg "${output}/graphs/heaping_reg.gph" "${output}/graphs/heaping_unreg.gph",title(Month of Birth) legendfrom("${output}/graphs/heaping_unreg.gph")
graph save "${output}/graphs/Figure4.gph", replace
graph export "${output}/graphs/Figure4.png", replace

restore
